/**
 * Created by rockyren on 14/12/2.
 */
describe('Unit: personal服务',function(){
  beforeEach(module('personalApp'));
  var $httpBackend;
  beforeEach(inject(function(_$httpBackend_){
    $httpBackend = _$httpBackend_;
  }));

  describe('CRUD personal baseinfo services',function(){
    var baseinfoServices;
    beforeEach(inject(function(_baseinfoServices_){
      baseinfoServices = _baseinfoServices_;
    }));

    var baseinfoUrl = 'api/personal/baseinfo';

    it('应该能请求个人信息',function(){
      $httpBackend.expectGET(baseinfoUrl).respond(200);
      baseinfoServices.get();
      $httpBackend.flush();
    });

    it('应该能求情更新个人信息',function(){
      var postData = {
        status: 'success'
      };
      $httpBackend.expectPUT(baseinfoUrl,postData).respond(200);
      baseinfoServices.update(postData);
      $httpBackend.flush();
    });
  });
});